package net.tv90.bfmccore.command;

import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class ReportCommand implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (label.equalsIgnoreCase("report") && sender instanceof Player) {
            if (args.length == 0) {
                sender.sendMessage("/report <玩家名称> <原因>");
                return true;
            }
            if (args.length == 2) {
                Player player = Bukkit.getPlayer(args[0]);
                String reason = args[1];
                sender.sendMessage("§e[管理员]举报玩家" + player + "成功(原因:" + reason + ")，已发送至管理员");
            }
            return true;
        }
        return true;
    }
}
